
import { baseUrl,imHttpUrl }  from  './config'
import { fetch ,postJson,fetchNullToken} from  './httpFly' 

//登录微信服务器 (激活session_key) 获取openid
export const wxServer= (data) => {  
	return fetch(baseUrl+'wx/auth',data)
}
//注册
export const register=(data)=>{
    return postJson(baseUrl+'wx/auth/register',data)
}

//首页banner
export const fetchBanner=(data)=>{
    return fetch(baseUrl+'banner/list',data)
}

//即将直播列表
export const fetchPlaySubjectList=(data)=>{
    return fetch(baseUrl+'play/subject/list',data)
}

//首页推荐课程列表
export const fetchRecommendSubjectList=(data)=>{
  return fetch(baseUrl+'recommend/subject/list',data)
}

//oss签名
export const fetchOssSign = body => {
    return fetch(baseUrl + 'oss/sign', body)
}

//话题标签
export const topicList=()=>{
  return fetch(baseUrl+'topic/tag/list')
}

//话题下文章列表
export const topicArticleList=(data)=>{
  return fetch(baseUrl+'topic/article/list',data)
}

//话题下文章列表
export const topicUserArticleList=(data)=>{
  return fetch(baseUrl+'user/article/list',data)
}

//用户话题文章点赞/取消点赞
export const topicArticleLike=(data)=>{
  return postJson(baseUrl+'topic/article/like',data)
}

//关于我们 / 联系我们
export const getSysInfo=(data)=>{
  return fetch(baseUrl+'sys/info',data)
}

//用户发布文章
export const addArtItem=(data)=>{
    return postJson(baseUrl+'topic/article/add',data)
}

//用户发布文章
export const addArticleComment=(data)=>{
  return postJson(baseUrl+'topic/article/comment/add',data)
}

//课程分类
export const sectionList=()=>{
  return fetch(baseUrl+'section/list')
}

//课程分类下的课程列表
export const sectionSubjectList=(data)=>{
  return fetch(baseUrl+'section/subject/list/'+data.id,data)
}

//课程详情
export const sectionSubjectDetail=(data)=>{
  return fetch(baseUrl+'section/subject/detail',data)
}
